package com.wjjm.spoonselling.dao;

import com.wjjm.spoonselling.pojo.Customer;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CustomerDao {

    @Select("select * from customer where name=#{name} and password=#{password}")
    Customer queryMerchantByNameAndPwd(Customer customer);

    @Select("select * from customer where name=#{name}")
    Customer queryMerchantByName(@Param("name") String name);

    @Update("update customer set name=#{name},password=#{password},phone=#{phone},address=#{address} where customerId=#{customerId}")
    int update(Customer customer);

    @Update("update customer set password=#{password} where name=#{name}")
    int updatePassword(Customer customer);

    @Insert("insert into customer values(#{customerId},#{name},#{password},#{phone},#{address})")
    void register(Customer customer);
}
